#!/bin/sh

PEAR_BOOT_DIR=%OPTWARE_TARGET_PREFIX%/tmp/pear
PEAR_DIR=%OPTWARE_TARGET_PREFIX%/share/pear
BIN_DIR=%OPTWARE_TARGET_PREFIX%/bin

PHP_FLAGS="-q -dshort_open_tag=0 -dsafe_mode=0"
PEAR_FLAGS="-d $PEAR_DIR -b $BIN_DIR"

# %OPTWARE_TARGET_PREFIX%/bin/php $PHP_FLAGS $PEAR_BOOT_DIR/install-pear.php $PEAR_FLAGS $PEAR_BOOT_DIR/package-*.xml
# %OPTWARE_TARGET_PREFIX%/bin/php $PHP_FLAGS $PEAR_BOOT_DIR/install-pear.php $PEAR_FLAGS $PEAR_BOOT_DIR/packages/*.tar
%OPTWARE_TARGET_PREFIX%/bin/php $PHP_FLAGS $PEAR_BOOT_DIR/install-pear-nozlib.phar $PEAR_FLAGS

mv -f %OPTWARE_TARGET_PREFIX%/etc/pear.conf %OPTWARE_TARGET_PREFIX%/etc/pear.conf.old
mv -f %OPTWARE_TARGET_PREFIX%/etc/pear.conf.new %OPTWARE_TARGET_PREFIX%/etc/pear.conf

rm -rf $PEAR_BOOT_DIR
